# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=cisco-snmp-slap
pkgver=5.daf0589
pkgrel=5
groups=('blackarch' 'blackarch-spoof' 'blackarch-networking'
        'blackarch-exploitation')
pkgdesc='IP address spoofing tool in order to bypass an ACL protecting an SNMP service on Cisco IOS devices.'
arch=('any')
url='https://github.com/nccgroup/cisco-snmp-slap'
license=('GPL3')
depends=('python2' 'python2-scapy')
makedepends=('git')
source=("git+https://github.com/nccgroup/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  sed -i 's|/usr/bin/env python|/usr/bin/env python2|' slap.py
}

package() {
  cd $pkgname

  install -Dm 755 slap.py "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 list.txt "$pkgdir/usr/share/$pkgname/list.txt"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

